﻿using Tszy.Unlimited.Base.Common;

namespace Tszy.Unlimited.Base.Extensions;

/// <summary>
/// GUID 扩展。
/// </summary>
public static class GuidExtensions
{
    /// <summary>
    /// 生成一个有序的 GUID。
    /// </summary>
    /// <returns></returns>
    public static Guid NewSequentialGuid(this Guid guid)
    {
        if (guid == Guid.Empty)
        {
            guid = IdentityGenerator.NewSequentialGuid();
        }

        return guid;
    }
}
